﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;

namespace Server
{

    class BusinessService : MarshalByRefObject, IBusinessService
    {
        private List<UserInfo> _allUserInfos = new List<UserInfo>();
 
        public BusinessService()
        {
            AddUserInfo("Ant", 24);
            AddUserInfo("Ant1", 25);
            AddUserInfo("Ant2", 26);
            AddUserInfo("Ant3", 27);
            AddUserInfo("Ant4", 28);
            AddUserInfo("Ant5", 29);
            AddUserInfo("Ant6", 30);
        }

        private void AddUserInfo(string name, int age)
        {
            _allUserInfos.Add(new UserInfo()
                {
                    Name = name,
                    Age = age
                });
        }

        public List<UserInfo> GetUserInfos()
        {
            return _allUserInfos;
        }

        public override object InitializeLifetimeService()
        {
            return null;
        }
    }
}
